﻿<#include "../common.html" />
<!DOCTYPE HTML>
<html>
<body>
<article class="cl pd-20">
	<form action="" method="post" class="form form-horizontal" id="form-member-add">
		<input type="text" value="${uuid}" id="uuid">
	<div class="row cl">
		<label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>属性名：</label>
		<div class="formControls col-xs-5 col-sm-4">
			<input type="text" class="input-text" placeholder="请使用标准JAVA变量格式命名" id="attrName" name="attrName" value="${name}">
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>属性类型：</label>
		<div class="formControls col-xs-9 col-sm-9">


			<input type="radio" id="radio-1" name="attrType" value="String" <#if type == 'String'>checked</#if>>
			<label for="radio-1">String</label>
			<input type="radio" id="radio-2" name="attrType" value="Integer" <#if type == 'Integer'>checked</#if>>
			<label for="radio-2">Integer</label>
			<input type="radio" id="radio-3" name="attrType" value="Date" <#if type == 'Date'>checked</#if>>
			<label for="radio-2">Date</label>
			<input type="radio" id="radio-4" name="attrType" value="BigDecimal" <#if type == 'BigDecimal'>checked</#if>>
			<label for="radio-2">Decimal</label>
			<input type="radio" id="radio-5" name="attrType" value="Long" <#if type == 'Long'>checked</#if>>
			<label for="radio-2">Long</label>
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>前台录入：</label>
		<div class="formControls col-xs-9 col-sm-9">
			<input type="radio" id="radio-11" name="inputRadio"  onclick="isInput(1)" value="1" <#if isInput == '1'>checked</#if>>
			<label for="radio-1">是</label>
			<input type="radio" id="radio-12" name="inputRadio" onclick="isInput(0)" value="0" <#if isInput == '0'>checked</#if>>
			<label for="radio-2">否</label>
			<a>长度:</a><input type="text" class="input-text" style="width: 60px" value="${length}" id="attrLength" name="attrLength">
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>备注：</label>
		<div class="formControls col-xs-5 col-sm-4">
			<input type="text" class="input-text"  value="" placeholder="例如:name的备注为'姓名'" id="remark" name="remark">
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>默认值：</label>
		<div class="formControls col-xs-5 col-sm-4">
			<input type="text" class="input-text" value="" placeholder="无" id="default" name="default" disabled>
		</div>
	</div>

		<input class="btn btn-primary radius" type="button" value="确定" onclick="save()">
	</form>
</article>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引

	function isInput(value){
		if(value == 1){
			$("#default").val("无");
			$("#default").attr("disabled",true);
		}else{
			$("#default").val('');
			$("#default").attr("disabled",false);
		}
	}

	function save(){
		var name = $("#attrName").val();
		var attrType = $("input[name='attrType']:checked").val();
		var attrLength = $("#attrLength").val()
		var remark = $("#remark").val();
		var isInput = $("input[name='inputRadio']:checked").val();
		var defaultVal = $("#default").val();
		var uuid = $("#uuid").val();
//		alert(name+attrType+"-"+isInput+"-"+remark+"-"+defaultVal+"-"+attrLength);
		parent.addField(name,attrType,attrLength,remark,isInput,defaultVal,uuid);
		parent.layer.close(index);
	}
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>